package cn.kimming.rpc.remoting.serialization;


import cn.kimming.rpc.common.constant.SerializationWay;
import cn.kimming.rpc.common.exception.RpcException;

public class SerializationFactory {
    public static ISerialization getSerialization(SerializationWay way) {
        switch (way) {
            case PROTOSTUFF:
                return ProtostuffSerialization.getInstance();
            case JDK:
                return JDKSerialization.getInstance();
            case HESSIAN:
                return HessianSerialization.getInstance();
        }
        throw new RpcException("不支持此序列化方式:" + way);
    }
}
